extends Card

func init():
	att.cry = 0
	lv = 4
	type = TYPE.MAGIC
	camp = "m_all" 
	name = "命运协议" 
	dec = "骰出一个六面骰子，根据点数获得效果。" 
	aiTab = "back" 
	tips = ["1点-游戏胜利","2点-抽牌到十张并减少3点费用费","3点-对方英雄获得50护甲和5攻击","4-点我方英雄获得50护甲和5攻击","5点-消灭我方所有随从","6点-对我方英雄造成99伤害。"]
	isUsable = false

func _use(card,cell):
	var q = sys.rndRan(1,6);
	match q:
		1:
			cardDeath(getHero().getOppHero())
		2:
			for i in range(11):
				if getHero().hand.items.size() < 10 :
					getHero().drawCard()
			for i in getHero().hand.items:
				if i.type == cons.TYPE.MAGIC:
					i.att.cry -= 3
				if i.type == cons.TYPE.CREATURE:
					i.att.cry -= 3

		3:
			getHero().getOppHero().att.atk += 5
			getHero().getOppHero().att.arm += 50
		4:
			getHero().att.atk += 5
			getHero().att.arm += 50
		5:
			scene.newQueueEff("e_zhiLiao",Vector2.ZERO,1.0)
			for i in scene.getAllCard(getHero(),2) :
				cardDeath(i)
		6:
			hurtCard(getHero(),99,false)

func aiW():
	return (10 - getHero().hand.getCardNum()) * 10